package com.yx.system.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.yx.system.dao.TdCategoryMapper;
import com.yx.system.entity.TdCategory;
import com.yx.system.service.TdCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service("tdCategoryService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class TdCategoryServiceImpl implements TdCategoryService {

    @Autowired
    private TdCategoryMapper tdCategoryMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tdCategoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TdCategory record) {
        return tdCategoryMapper.insert(record);
    }

    @Override
    public int insertSelective(TdCategory record) {
        return tdCategoryMapper.insertSelective(record);
    }

    @Override
    public TdCategory selectByPrimaryKey(Integer id) {
        return tdCategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TdCategory record) {
        return tdCategoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TdCategory record) {
        return tdCategoryMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TdCategory> queryAll() {
        return tdCategoryMapper.queryAll();
    }

    @Override
    public List<TdCategory> queryList(Map<String, Object> map) {
        return tdCategoryMapper.queryList(map);
    }

    @Override
    public Page<TdCategory> queryPageList(Page<TdCategory> page, Map<String, Object> map) {
        page.setRecords(tdCategoryMapper.queryPageList(page, map));
        return page;
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tdCategoryMapper.queryTotal(map);
    }

    @Override
    public List<TdCategory> findAll() {
        return tdCategoryMapper.queryAll();
    }
}
